#include<bits/stdc++.h>
using namespace std;
using ll=long long;
const int N=4;
const int mod=1e9+7;
const int N1=1005,M1=32;
int n,m,x;
int y;
int f[N1][M1][M1];
struct M{
    ll a[N][N];
};
M operator*(const M x,const M y){
    M an;
    for(int i=0;i<N;++i){
        for(int j=0;j<N;++j){
            ll s=0;
            for(int k=0;k<N;++k){
                s=(s+x.a[i][k]*y.a[k][j])%mod;
            }
            an.a[i][j]=s;
        }
    }
    return an;
}
M ksm(M x,int y){
    M an;
    for(int i=0;i<N;++i){
        for(int j=0;j<N;++j){
            an.a[i][j]=(i==j);
        }
    }
    while(y){
        if(y&1)an=an*x;
        x=x*x;
        y>>=1;
    }
    return an;
}
M ba,an,no;
int main(){
    freopen("pearl.in","r",stdin);
    freopen("pearl.out","w",stdout);
    cin>>n>>m>>x;
    for(int i=0;i<m;++i){
        char a;
        cin>>a;
        y+=(1<<i)*(a-'0');
    }
    if(m!=1){
        for(int i=0;i<(1<<m);++i){
            if(x==1&&i!=y)continue;
            f[1][i][0]=1;
        }
        for(int i=2;i<=n;++i){
            for(int no=0;no<(1<<m);++no){
                if(i==x&&no!=y)continue;
                for(int s=0;s<(1<<m);++s){
                    for(int la=0;la<(1<<m);++la){
                        f[i][no][s^(la*no%(1<<m))]=(f[i][no][s^(la*no%(1<<m))]+f[i-1][la][s])%mod;
                    }
                }
            }
        }
        ll s=0;
        for(int t=0;t<(1<<m);++t){
            for(int i=0;i<(1<<m);++i){
                s=(s+1ll*i*f[n][t][i]%mod)%mod;
            }
        }
        cout<<s;
        return 0;
    }
    for(int i=0;i<(1<<m);++i){
        for(int j=0;j<(1<<m);++j){
            an.a[i][j]=(i==j);
            if(i&&j){
                ba.a[i*2+1][j*2]++;
                ba.a[i*2][j*2+1]++;
            }
            else{
                ba.a[i*2][j*2]++;
                ba.a[i*2+1][j*2+1]++;
            }
        }
    }
    an=an*ksm(ba,x-1);
    for(int i=0;i<(1<<m);++i){
        if(i&&y){
            no.a[i*2+1][y*2]++;
            no.a[i*2][y*2+1]++;
        }
        else{
            no.a[i*2][y*2]++;
            no.a[i*2+1][y*2+1]++;
        }
    }
    an=an*no;
    an=an*ksm(ba,n-x);
    cout<<(an.a[0][1]+an.a[0][3])%mod;
    return 0;
}
